package message

const (
	LoginMesType            = "LoginMes"
	LoginResMesType         = "LoginResMes"
	RegisterMesType         = "RegisterMes"
	RegisterResMesType      = "RegisterResMes"
	OfflineMesType          = "OfflineMes"
	SmsMesType              = "SmsMes"
	SmsPrivateMesType       = "SmsPrivateMes"
	NotifyUserStatusMesType = "NotifyUserStatusMes"
	FileMesType             = "FileMes"
	FileResMesType          = "FileResMes"
	UserOnline              = 201 //用户在线
	UserOffline             = 401 //用户离线
	FileReceive             = "ok"
	FileRefuse              = "No"
)

type Message struct {
	Type string `json:"type"`
	Data string `json:"data"`
}

//登录消息
type LoginMes struct {
	UserId   int    `json:"userId"`
	UserPwd  string `json:"userPwd"`
	UserName string `json:"userName"`
}

type LoginResMes struct {
	Code        int      `json:"code"`
	OnlineUsers []string `json:"onlineUsers"`
	Error       string   `json:"error"`
}

//注册消息
type RegisterMes struct {
	User User `json:"user"`
}

type RegisterResMes struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}

//通知用户状态消息
type NotifyUserStatusMes struct {
	UserId   int    `json:"userId"`
	UserName string `json:"userName"`
	Status   int    `json:"status"`
}

//通话消息
type SmsMes struct {
	Content string `json:"content"`
	User    `json:"user"`
}

//私聊消息
type SmsPrivateMes struct {
	Content string `json:"content"`
	User    `json:"user"`
	DstUser int `json:"dstUser"`
}

//下线消息
type OfflineMes struct {
	UserId   int    `json:"userId"`
	UserName string `json:"userName"`
}

//文件信息
type FileMes struct {
	FileName string `json:"fileName"`
	UserId   int    `json:"res"`
}

//接收文件信息
type FileResMes struct {
	FileName string `json:"fileName"`
	Res      string `json:"res"`
}
